/**
 * 添加用户
 * @param user
 */
import request from "@/utils/request";

const BASE_URL = '/user'

export const addUser = (user: FormData) => {
  return request.post(`${BASE_URL}/add`, user);
}

export const getAll = () => {
  return request.get(`${BASE_URL}/getAll`);
}

export const checkLogin = (user: FormData) => {
  return request.post(`${BASE_URL}/login` , user);
}

export const update = (user: FormData) => {
  return request.post(`${BASE_URL}/update` , user);
}

export const getAvatar = (id: string) => {
  return request.get(`${BASE_URL}/avatar/${id}`);
}

export const uploadAvatar = (url: any) => {
  return request.post(`${BASE_URL}/uploadAvatar` , url)
}